/*
 * @Author: 一路向阳 tt_sunzhenfeng@163.com
 * @Date: 2024-05-22 13:29:16
 * @LastEditors: 一路向阳 tt_sunzhenfeng@163.com
 * @LastEditTime: 2024-05-29 23:01:34
 * @FilePath: \vue3_nuxt_demo\nuxt.config.ts
 * @Description: Nuxt配置
 */
// https://nuxt.com/docs/api/configuration/nuxt-config
import Components from 'unplugin-vue-components/vite';
import {
  AntDesignVueResolver,
  ElementPlusResolver,
  VantResolver
} from 'unplugin-vue-components/resolvers';
import Icons from 'unplugin-icons/vite';
import IconsResolver from 'unplugin-icons/resolver';


const initConfig = {
  devtools: { enabled: true },
  runtimeConfig:{
    //私密钥匙
    SecretId: process.env.SECRET_ID,
    SecretKey: process.env.SECRET_KEY,
    DB_HOST: process.env.DB_HOST,
    DB_USER: process.env.DB_USER,
    DB_DATABASE: process.env.DB_DATABASE,
    DB_PASSWORD: process.env.DB_PASSWORD,
    public:{
      //公开
      BUCKET: process.env.BUCKET,
      REGION: process.env.REGION,
    }
  },
  modules: [
    '@pinia/nuxt', 
    '@pinia-plugin-persistedstate/nuxt'
  ],
  vite: {
    plugins: [
      Components({
        resolvers: [
          AntDesignVueResolver({
            importStyle: 'less'
          }),
          ElementPlusResolver(),
          VantResolver(),
          IconsResolver({
            prefix: 'i',
            enabledCollections:['ep','ant-design','mdi','ph','ion']
          })
        ]
      }),
      Icons({
        autoInstall: true,
      })
    ],
    css: {
      preprocessorOptions: {
        less: {
          modifyVars: {
            'primary-color': '#ea6f5a'
          },
          javascriptEnabled: true
        }
      }
    },
    ssr: {
      noExternal: ['ant-design-vue']
    }
  },
}

export default defineNuxtConfig(initConfig);

